﻿Public Class frmEditVentas


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     
        Limpiar(Gb_01)
        Limpiar(Gb_02)
        Limpiar(Gb_03)
        Limpiar(gbValores)

        puntajeTotalVTA = 0
        PsaludoVTA = 0
        PempatiaVTA = 0
        PindagacionVTA = 0
        PmanejoVTA = 0
        PentusiasmoVTA = 0
        PspeechVTA = 0
        PpresentacionVTA = 0
        PmecanismoVTA = 0
        PpideVTA = 0
        lbl_puntaje.Text = 0
        'frmSearchLlamadas.Show()
        Me.Close()
    End Sub

    Private Sub frmEditVentas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'frmSearchLlamadas.Hide()
        'Cargo los combos desde la base
        CargarOptSaluVta(cbo_salu)
        CargarOptEmpaVta(cbo_empatia)
        CargarOptIndVta(cbo_indagacion)
        CargarOptManVta(cbo_manejo)
        CargarOptEntVta(cbo_entusiasmo)
        CargarOptSpeechVta(cbo_speech)
        CargarOptPresVta(cbo_presentacion)
        CargarOptMecVta(cbo_mecanismo)
        CargarOptPideVta(cbo_pide)

        'Cargo las variables globales con los valores correspondientes:
        PsaludoVTA = txtv01.Text
        PempatiaVTA = txtv02.Text
        PindagacionVTA = txtv03.Text
        PmanejoVTA = txtv04.Text
        PentusiasmoVTA = txtv05.Text
        PspeechVTA = txtv06.Text
        PpresentacionVTA = txtv07.Text
        PmecanismoVTA = txtv08.Text
        PpideVTA = txtv09.Text
        puntajeTotalVTA = lbl_puntaje.Text
    End Sub

    Private Sub cbo_salu_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_salu.SelectedIndexChanged
        Dim valorSal As New C_todosVentas
        PsaludoVTA = valorSal.valorSalu(cbo_salu)
        txtv01.Text = PsaludoVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_empatia_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_empatia.SelectedIndexChanged
        Dim valorEmp As New C_todosVentas
        PempatiaVTA = valorEmp.valorEmpatia(cbo_empatia)
        txtv02.Text = PempatiaVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_indagacion_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_indagacion.SelectedIndexChanged
        Dim valorInd As New C_todosVentas
        PindagacionVTA = valorInd.valorIndagacion(cbo_indagacion)
        txtv03.Text = PindagacionVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_manejo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_manejo.SelectedIndexChanged
        Dim valorManejo As New C_todosVentas
        PmanejoVTA = valorManejo.valorManejo(cbo_manejo)
        txtv04.Text = PmanejoVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_entusiasmo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_entusiasmo.SelectedIndexChanged
        Dim valorEntu As New C_todosVentas
        PentusiasmoVTA = valorEntu.valorEntusiasmo(cbo_entusiasmo)
        txtv05.Text = PentusiasmoVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_speech_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_speech.SelectedIndexChanged
        Dim valorSpeech As New C_todosVentas
        PspeechVTA = valorSpeech.valorSpeech(cbo_speech)
        txtv06.Text = PspeechVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_presentacion_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_presentacion.SelectedIndexChanged
        Dim valorPresent As New C_todosVentas
        PpresentacionVTA = valorPresent.valorPresentacion(cbo_presentacion)
        txtv07.Text = PpresentacionVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_mecanismo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_mecanismo.SelectedIndexChanged
        Dim valorMeca As New C_todosVentas
        PmecanismoVTA = valorMeca.valorMecanismo(cbo_mecanismo)
        txtv08.Text = PmecanismoVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub cbo_pide_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbo_pide.SelectedIndexChanged
        Dim valorPide As New C_todosVentas
        PpideVTA = valorPide.valorPide(cbo_pide)
        txtv09.Text = PpideVTA
        puntajeTotalVTA = 0
        puntajeTotalVTA = PsaludoVTA + PempatiaVTA + PindagacionVTA + PmanejoVTA + PentusiasmoVTA + PspeechVTA + PpresentacionVTA + PmecanismoVTA + PpideVTA
        lbl_puntaje.Text = puntajeTotalVTA
    End Sub

    Private Sub bt_guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_guardar.Click
        Dim ActualizarLLamadaVTA As New edit_callsVTA
        ActualizarLLamadaVTA.updateCallVTA()
        frmSearchLlamadas.Close()
        ' frmIndex.Show()
        Me.Close()
    End Sub
End Class